package com.oig.sys.msg.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Schema
@Data
public class MqConfigDto {

	@Schema(description = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotNull(message = "参数错误,配置id不能为空", groups={GroupEdit.class})
	private Integer id;

	@Schema(description = "所属系统id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotNull(message = "参数错误,所属系统id不能为空", groups={GroupAdd.class, GroupEdit.class})
	private Integer systemId;
	@Schema(description = "所属系统名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,所属系统名称不能为空", groups={GroupAdd.class, GroupEdit.class})
	private String systemName;

	@Schema(description = "主业务类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,主业务类型不能为空", groups={GroupAdd.class, GroupEdit.class})
	private String businessType;

	@Schema(description = "关联单据类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,关联单据类型不能为空", groups={GroupAdd.class, GroupEdit.class})
	private String relationType;

	@Schema(description = "rabbitmq的路由exchange", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,exchange不能为空", groups={GroupAdd.class, GroupEdit.class})
	private String producerExchange;
	@Schema(description = "rabbitmq的route_key", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,route_key不能为空", groups={GroupAdd.class, GroupEdit.class})
	private String producerKey;


	@Schema(description = "创建人")
	private String createName;
	@Schema(description = "创建人id")
	private Integer createId;

	@Schema(description = "创建时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;

	@Schema(description = "消息修改人id")
	private Integer lastUpdateId;
	@Schema(description = "消息修改人")
	private String lastUpdateName;
	@Schema(description = "消息修改人时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date lastUpdateTime;


}
